﻿using ClientOverflow.DataTransferObjects;
using ClientOverflow.ViewModels.Services;

namespace ClientOverflow.ViewModels.QuestionViewViewModels
{
    /// <summary>
    /// VoteAnswerDownCommand is a command in charge of updating a vote down to an answer by a user.
    /// The vote is sent to the server through a WCF service.
    /// </summary>
    internal class VoteAnswerDownCommand : VoteAnswerCommandBase
    {
        public VoteAnswerDownCommand(Answer answer)
            : base(answer)
        {
        }

        protected override void Vote(IClientOverflowService serviceClient, User votingUser)
        {
            serviceClient.AddAnswerVoteDown(answer, votingUser);
        }
    }
}